<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 86186
  Date: 2021/1/13
  Time: 10:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="../css/css.css">
    <link rel="stylesheet" type="text/css" href="../css/amazeui.min.css">
    <script type="text/javascript" src="../js/jquery-3.3.1.min.js"></script>
</head>
<body>
<div id="pageAll">
    <div class="pageTop">
        <div class="page">
            <img src="../images/admin/coin11.png" /><span><a href="../manage/index.html" target="_top">首页</a>&nbsp;-&nbsp;-</span>&nbsp;留言簿
        </div>
    </div>

    <div class="page">
        <!-- user页面样式 -->
        <div class="connoisseur">
            </div>
            <!-- user 表格 显示 -->
            <div class="conShow">
                <table border="1" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="160px" class="tdColor tdC">ID</td>
                        <td width="180px" class="tdColor">姓名</td>
                        <td width="600px" class="tdColor">留言内容</td>
                        <td width="180px" class="tdColor">状态</td>
                        <td width="240px" class="tdColor">操作</td>
                    </tr>
                    <c:forEach items="${commentList}" var="comm">
                        <tr height="40px">
                            <td>${comm.ecId}</td>
                            <td>${comm.ecNickName}</td>
                            <td>${comm.ecContent}</td>
                            <%--判断回复内容是否为空来改变状态--%>
                            <td>${comm.ecReply !="" ?"已回复":"未回复"}</td>
                            <td>
                                <a href="../CommentByIdServlet?ecId=${comm.ecId}">
                                    <img class="operation" src="../images/admin/update.png">
                                </a>
                                &nbsp;&nbsp;
                                <a href="../CommentDelServlet?ecId=${comm.ecId}" onclick="javascript:del_sure()">
                                    <img class="operatio ndelban" src="../images/admin/delete.png">
                                </a>
                            </td>
                        </tr>
                    </c:forEach>
                </table>
            </div>
            <!-- user 表格 显示 end-->


        </div>
        <!-- user页面样式end -->
        <div class="am-fr">
            <ul class="am-pagination">
                <li class="am-active"><a href="../CommentServlet?pageIndex=0">首页</a></li>
                <li><a href="../CommentServlet?pageIndex=${pageIndex-1}">上一页</a></li>
                <li><a href="../CommentServlet?pageIndex=${pageIndex+1}">下一页</a></li>
                <li><a href="../CommentServlet?pageIndex=${totalPages}">尾页</a></li>
            </ul>
        </div>
    </div>

</div>
</body>
<script type="text/javascript" language="JavaScript">
    function del_sure() {
        var gnl=confirm("你确定要删除吗？");
        if(gnl==true){
            return true;
        }
        else {
            return false;
        }
    }
</script>
</html>
